$(document).ready(function(){
	
	//设置遮罩层
	var Xwidth=document.documentElement.clientWidth;
	var Yheight=document.documentElement.clientHeight;
	mask.style.width=Xwidth+"px";
	mask.style.height=Yheight+"px";
	mask.style.background="black";
	//设置登陆框位置
	var Lwidth=login.offsetWidth;
	var LHeight=login.offsetHeight;
	// $('#login').css('left',(Xwidth-Lwidth)/2+"px");
	// $('#login').css('top',(Yheight-LHeight)/4+"px");

		$("#login").css("display","none");
		$("#mask").css("display","none");

		$('.dl').on('click',function(){
			show()
		});
		$("#sure").attr("disabled","disabled");
			//确定聊天昵称

	$("#sureName").click(function(){
		if ($("#newName").val()) {

			$("#name").text($("#newName").val());
			$("#name").css("color","#4f1f31");
			close();
			$("#sure").attr("disabled",false);
		}

	})
	//关闭登陆页面
	$("#close").click(function(){
		close();
	})



			//发送聊天内容
	$("#sure").on('click',function () {
		if ($('#name').html()) {
			$("#area").html($("#inp").val());
		}			
	})
	function show(){
		$("#login").css("display","block");
		$("#mask").css("display","block");
	}
	function close(){
		$("#login").css("display","none");
		$("#mask").css("display","none");
	}



})
